<?php
include_once('../../config.inc.php');
include_once($lb['dir'] . 'include/db/' . $lb['db_type'] . '.inc.php');
include_once($lb['dir'] . 'include/db.inc.php');
include_once('./type_image.inc.php');

if(isset($_GET['id'])){
	$lb['db'] = new lb_db();
	if(isset($_GET['thumbnail'])){
		$thumbnail = true;
	}else{
		$thumbnail = false;
	}
	if(!($image = type_image::image(intval($_GET['id']), $thumbnail))){
		exit();
	}
	header('Content-Type: ' . $image['mime']);
	if($image['size'] > 0){
		header('Content-Length: ' . $image['size']);
	}
	print($image['content']);
}
?>